package com.ruoyi.web.controller.biz.hugong.openapi;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.vo.DealOrderVo;
import com.ruoyi.system.domain.vo.OrderDetailVo;
import com.ruoyi.system.domain.vo.OrderListVo;
import com.ruoyi.system.domain.vo.UpdateDealOrderVo;
import com.ruoyi.system.service.IOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName OrderOpenApi
 * @Description
 * @Author sizegang
 * @Date2025/4/20 23:42
 **/
@RestController
@RequestMapping("/openapi/order")
public class OrderOpenApi extends BaseController {

    @Autowired
    private IOrderService orderService;

    @ApiOperation("下单")
    @PostMapping("consumerDealOrder")
    public AjaxResult consumerDealOrder(@RequestBody DealOrderVo dealOrderVo) {
        return success(orderService.consumerDealOrder(dealOrderVo));
    }

    @ApiOperation("修改订单")
    @PostMapping("updateDealOrder")
    public AjaxResult updateDealOrder(@RequestBody UpdateDealOrderVo updateDealOrderVo) {
        return success(orderService.updateDealOrder(updateDealOrderVo));
    }

    @ApiOperation("查询订单详情")
    @PostMapping("queryOrderDetail")
    public AjaxResult queryOrderDetail(@RequestBody OrderDetailVo orderDetailVo) {
        return success(orderService.queryOrderDetail(orderDetailVo));
    }

    @ApiOperation("查询订单列表")
    @PostMapping("queryDetailListByConsumerNo")
    public AjaxResult queryDetailListByConsumerNo(@RequestBody OrderListVo orderListVo) {
        return success(orderService.queryDetailListByConsumerNo(orderListVo));
    }
}
